<!DOCTYPE html>
	<html>
	<head>
	<meta charset="utf-8">
	<title>菜鸟教程(runoob.com)</title>
	</head>
	<body>
	 <pre>
	<h1>虚拟目录和虚拟主机</h1>
	 <h2>在本地环境下</h2>
     C:\Windows\System32\drivers\etc\hosts 里
     #	127.0.0.1       localhost
     #	::1             localhost
        #127.0.0.1    localhost
     #   127.0.0.1    www.myblog.com
       127.0.0.1    www.2016.com
     #  127.0.0.1   www.t5index.com
       127.0.0.1   www.2018a.com
      127.0.0.1   www.nfbf.com

      E:\xampp\apache\conf\httpd.conf 里 写
      # Virtual hosts
      Include conf/extra/httpd-vhosts.conf

      E:\xampp\apache\conf\extra\httpd-vhosts.conf 里写
      #配置自己的虚拟主机
      &lt;VirtualHost *:80&gt; 
      #DocumentRoot后面修改为网站的根路径
      DocumentRoot "e:/xampp/2018/47.94.136.51/t5/public/nfbf.php" 
      #增加域名的配置
      ServerName www.nfbf.com
      #相当于 http://www.nfbf.com
      #设置欢迎页面
      DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html
      &lt;Directory /&gt;
      Options FollowSymLinks 
      AllowOverride None
      #访问权限设置
      Order allow,deny
      Allow from all
      &lt;/Directory&gt;
      &lt;/VirtualHost&gt; 


 <h2>在阿里云环境下</h2>
 /opt/lampp/etc/http.conf 里写
 # Virtual hosts
 Include etc/extra/httpd-vhosts.conf


 /opt/lampp/etc/extra/httpd-vhosts.conf

 #配置自己的虚拟主机
&lt;VirtualHost *:80&gt; 
#DocumentRoot后面修改为网站的根路径
DocumentRoot "/opt/lampp/htdocs/t5/public/nfbf.php" 
#增加域名的配置
ServerName nfbfhjk.com.cn
#设置欢迎页面
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html
&lt;Directory /&gt;
Options FollowSymLinks 
AllowOverride None
#访问权限设置
Order allow,deny
Allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt; 

</pre>

	
	 
	</body>
	</html>
